package spring.in.action.chapter_03.spel;

import java.util.List;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class SpELBean
{
    @Value("#{1E1}")
    public long num;

    @Value("#{'s' + 't' + 'r'}")
    public String str;

    @Value("#{'bool' eq 'bool'}")
    public boolean bool;

    @Value("#{disc1}")
    public BankDisc disc;

    @Value("#{disc1.title}")
    public String title;

    @Value("#{disc1.toString()}")
    public String toString;

    @Value("#{null?.toUpperCase()}")
    public String Null;

    @Value("#{T(Math).PI}")
    public double PI;

    @Value("#{null?:'Elvis'}")
    public String Elvis;

    @Value("#{'123' matches '\\d+' }")
    public boolean matches;

    @Value("#{discs.^[artist eq 'A1']}")
    public List<BankDisc> discs;
    
    @Value("#{discs.![title]}")
    public String[] Titles;
}
